﻿<%@ Page Title="" culture="en-GB" Language="C#" MasterPageFile="~/MasterPages/AdminMaster.master" AutoEventWireup="true" CodeFile="BriefMasterModify.aspx.cs" Inherits="Admin_BriefMasterModify" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    
<script type="text/javascript">
    var WindowObjectReference; // global variable
    function onClickLink(strPath) {

        WindowObjectReference = window.open(strPath, "DescriptiveWindowName", "resizable=yes,scrollbars=yes,status=yes");

    }
</script>
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
        //function validateDOB() {
        //    var enteredValue = $("#txtDOB");
        //    var enteredAge = getAge(enteredValue.value);
        //    if (enteredAge > 18) {
        //        alert("Start Date not valid");
        //        enteredValue.focus();
        //        return false;
        //    }
        //}
        //function getAge(DOB) {
        //    var today = new Date();
        //    var birthDate = new Date(DOB);
        //    var age = today.getFullYear() - birthDate.getFullYear();
        //    var m = today.getMonth() - birthDate.getMonth();
        //    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
        //        age--;
        //    }
        //    return age;
        //}   

        </script>
    <script>
        function calendarShown(sender, args) {
            sender._popupBehavior._element.style.zIndex = 10005;
        }
    </script>
    <script type="text/javascript">
        function validateFileSize() {
            var uploadControl = document.getElementById('<%= txtUploadDoc1.ClientID %>');
            var lblSize = document.getElementById('<%= lblMaxFileSize.ClientID %>');
            if (uploadControl.files[0].size > 5342880) {
                lblSize.innerText = "Uploaded document file size should not be greater than 5 MB.";
                uploadControl.value = "";
                return false;
            }
            else {
                lblSize.innerText = "";
                return true;
            }
        }
        function validateFileSize1() {
            var uploadControl = document.getElementById('<%= txtUploadDoc2.ClientID %>');
            var lblSize = document.getElementById('<%= lblMaxFileSize2.ClientID %>');
            if (uploadControl.files[0].size > 5342880) {
                lblSize.innerText = "Uploaded document file size should not be greater than 5 MB.";
                uploadControl.value = "";
                return false;
            }
            else {
                lblSize.innerText = "";
                return true;
            }
        }
    </script>
    <asp:ScriptManager ID="ScriptID" runat="server"></asp:ScriptManager>
    <table style="width: 100%" id="TABLE2" cellspacing="1" cellpadding="1" border="0">
                <tbody>
                    <tr>

                        
                        <td colspan="3" style="text-align: left; font-size:30px;">
                            <asp:Label ID="lblTitle" runat="server" CssClass="maintitle" Text="Add Brief Master"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 45%; height: 17px" align="right">
                        </td>
                        <td class="auto-style1">
                        </td>
                        <td style="width: 54%; height: 17px">
                            <asp:Label ID="lblMessage" runat="server" Font-Bold="True"></asp:Label>
                        </td>
                    </tr>
                    <%-- <asp:Button ID="btnCancel" runat="server" CausesValidation="false" OnClick="btnCancel_OnClick" SkinID="buttonSkin" Text="Cancel" />--%>
                     <tr>
                        <td style="vertical-align: middle;width: 20%;" align="right" class="auto-style3">
                            Country Name &nbsp;<font color="red">*</font>
                        </td>
                        <td class="auto-style5">&nbsp;&nbsp;:&nbsp;&nbsp;
                        </td>
                         <td class="auto-style6">
                              <asp:DropDownList ID="ddlCountryName" runat="server"  Width="230px" MaxLength="50" OnSelectedIndexChanged="DDCountryName_SelectedIndexChanged">                               
                                                        
                            </asp:DropDownList>&nbsp; <asp:RequiredFieldValidator ID="reqActivityName" ControlToValidate="ddlCountryName" InitialValue="0" runat="server" ErrorMessage="Select Country Name." ForeColor="Red"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td style="vertical-align: middle;width: 20%;" align="right" class="auto-style3">
                            Brief Title &nbsp;<font color="red">*</font>
                        </td>
                        <td>&nbsp;&nbsp;:&nbsp;&nbsp;
                        </td>
                        <td style="width: 54%">
                            <asp:TextBox ID="txtBriefTitle" runat="server" Width="220px" MaxLength="50"></asp:TextBox>&nbsp; <asp:RequiredFieldValidator ID="RequiredFieldValidator1"  ControlToValidate="txtBriefTitle" runat="server" ErrorMessage="Enter Brief Title." ForeColor="Red"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                     <tr>
                        <td style="vertical-align: middle;width: 20%;" align="right" class="auto-style3">
                            Brief Description  &nbsp;<font color="red">*</font>
                        </td>
                        <td class="auto-style2">&nbsp;&nbsp;:&nbsp;&nbsp;
                        </td>
                        <td style="width: 54%">
                            <asp:TextBox ID="txtBriefDescription" TextMode="MultiLine"  runat="server" Width="220px" MaxLength="50"></asp:TextBox>&nbsp; <asp:RequiredFieldValidator ID="RequiredFieldValidator2"  ControlToValidate="txtBriefDescription" runat="server" ErrorMessage="Enter Brief Description." ForeColor="Red"></asp:RequiredFieldValidator>
                        </td>
                    </tr>                  
                     <tr>
                        <td style="vertical-align: middle;width: 20%;" align="right" class="auto-style3">
                            Brief Start Date &nbsp;<font color="red">*</font>
                        </td>
                        <td class="auto-style2">&nbsp;&nbsp;:&nbsp;&nbsp;
                        </td>
                        <td style="width: 54%">                                                   
                               <asp:TextBox ID="txtBriefSDate" runat="server" MaxLength="50" placeholder="Enter Brief Start Date" ViewStateMode="Enabled" Width="173px" cultureinvariantvalues="true"></asp:TextBox>  
                               <asp:CalendarExtender ID="mdlStartDate" runat="server" Format="dd/MM/yyyy" PopupButtonID="popcalender1" OnClientShown="calendarShown"   TargetControlID="txtBriefSDate" />
                                 <i class="icon-th" id="popcalender1"></i>
                                   <asp:RequiredFieldValidator ID="reqBriefSDate" runat="server" ControlToValidate="txtBriefSDate" Display="Dynamic" ErrorMessage="Please select Brief Start Date" ForeColor="Red"></asp:RequiredFieldValidator>
                        </td>
                    </tr>                                                                             
                     <tr runat="server" visible="false">
                        <td style="vertical-align: middle;width: 20%;" align="right" class="auto-style3">
                            Brief End Date &nbsp;
                        </td>
                        <td class="auto-style2">&nbsp;&nbsp;:&nbsp;&nbsp;
                        </td>
                        <td style="width: 54%">
                            <%--<asp:TextBox ID="txtBriefEDate" TextMode="Date" runat="server" Width="220px" MaxLength="50"></asp:TextBox>--%>
                             <%--<div class="controls input-append date to_date" data-date="" data-date-format="dd MM yyyy" data-link-field="dtp_input1" data-link-format="yyyy-mm-dd">--%>
                                                            
                               <asp:TextBox ID="txtBriefEDate" runat="server" MaxLength="50" placeholder="Enter Brief End Date" ViewStateMode="Enabled" Width="173px" cultureinvariantvalues="true"></asp:TextBox>
                                    <%--<span class="add-on"><i class="icon-remove"></i><i class="icon-th"></i></span>--%>
                                 <asp:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yyyy" PopupButtonID="popcalender2" OnClientShown="calendarShown"   TargetControlID="txtBriefEDate" />
                                    <i class="icon-th" id="popcalender2"></i>
                                    <asp:RequiredFieldValidator ID="reqBriefEDate" runat="server" ControlToValidate="txtBriefEDate" Display="Dynamic" ErrorMessage="Please select Brief End Date" ForeColor="Red" ValidationGroup="NextValidation"></asp:RequiredFieldValidator>
                            

                                    <%--<asp:RegularExpressionValidator ID="regBriefEDate" runat="server" ControlToValidate="txtBriefEDate" Display="Dynamic" ErrorMessage="Wrong date" Font-Bold="true" ForeColor="Red" Tooltip="Please enter date in dd/mm/yyyy format" ValidationExpression="(((0|1)[1-9]|2[1-9]|3[0-1])\/(0[1-9]|1[0-2])\/((19|20)\d\d))$" ValidationGroup="NextValidation"></asp:RegularExpressionValidator>--%>
                               <%-- </div>--%>
                        </td>
                    </tr>
                    <tr>
                         <td style="vertical-align: middle;width: 20%;" align="right" class="auto-style3">
                            
                        </td>
                        <td class="auto-style2">
                        </td>
                        <td>
                            <asp:CompareValidator id="txtBriefMasterDate" runat="server" controltocompare="txtBriefEDate"   display="Dynamic"  enableclientscript="true" 
                                   controltovalidate="txtBriefSDate" 
                                   errormessage="Start date must be less than End date" 
                                   type="Date" 
                                   setfocusonerror="true" 
                                   operator="LessThanEqual" 
                                   text="Start date must be less than End date" ForeColor="Red" />
                          <%--  <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtBriefSDate" cultureinvariantvalues="true"
        ControlToValidate="txtBriefEDate" ErrorMessage="Textbox2 is greater then Textbox1" LessThanEqual
        Operator="GreaterThan" Type="Date"></asp:CompareValidator>--%>
                        </td>
                    </tr>
                   
                    <tr>
                        <td style="width: 45%;vertical-align:text-top; padding-top:10px;" align="right">
                            Brief Document &nbsp;<font color="red">*</font>
                        </td>
                        <td class="auto-style2" style="vertical-align:text-top;padding-top:10px;">&nbsp;&nbsp;:&nbsp;&nbsp;
                        </td>
                        <td style="width: 54%">
                            <asp:FileUpload ID="txtUploadDoc1" Width="220px"  AllowMultiple="true" runat="server" onchange="validateFileSize();" />
                            <asp:Label ID="lblBriefDocument"  runat="server" style="color: black"></asp:Label><br /> 
                            <asp:Label runat="server" ID="lblMaxFileSize" Text="" ForeColor="Red" Visible="true" Display="Dynamic"></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5"  ControlToValidate="txtUploadDoc1" Display="Dynamic" runat="server" ErrorMessage="Upload Brief Document." ForeColor="Red"></asp:RequiredFieldValidator >
                      <%-- <asp:CustomValidator ID="cstBriefMasterResume" runat="server" ForeColor="red" Display="Dynamic" OnServerValidate="BriefMasterResume_ServerValidate" ValidationGroup="NextValidation"></asp:CustomValidator>--%>
                             
                            <asp:HiddenField runat="server" ID="hdnUploadPic" />
                        
                        </td>
                    </tr>

                    <tr>
                        <td style="width: 45%;vertical-align:text-top; padding-top:10px;" align="right">
                            Guide Discussion Document &nbsp;<font color="red">*</font>
                        </td>
                        <td class="auto-style2" style="vertical-align:text-top;padding-top:10px;">&nbsp;&nbsp;:&nbsp;&nbsp;
                        </td>
                        <td style="width: 54%">
                            <asp:FileUpload ID="txtUploadDoc2" Width="220px"  AllowMultiple="true" runat="server" onchange="validateFileSize1();" /> 
                            <asp:Label ID="lblGDDocument"  runat="server" style="color: black"></asp:Label><br />
                            <asp:Label runat="server" ID="lblMaxFileSize2" Text="" ForeColor="Red" Visible="true" Display="Dynamic"></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3"  ControlToValidate="txtUploadDoc2" Display="Dynamic" runat="server" ErrorMessage="Upload GD Document." ForeColor="Red"></asp:RequiredFieldValidator>
                      <%-- <asp:CustomValidator ID="cstBriefMasterResume" runat="server" ForeColor="red" Display="Dynamic" OnServerValidate="BriefMasterResume_ServerValidate" ValidationGroup="NextValidation"></asp:CustomValidator>--%>
                             
                            <asp:HiddenField runat="server" ID="hdnUploadPic2" />
                        
                        </td>
                    </tr>
              
                     <tr>
                        <td style="width: 45%" align="right">
                            Is Active&nbsp;<font color="red">*</font>
                        </td>
                        <td >
                            &nbsp;&nbsp;:&nbsp;&nbsp;</td>
                        <td style="width: 54%">
                            <asp:CheckBox ID="chkIsactive" runat="server" /> 
                        </td>
                    </tr>
                        <tr>
                            <td align="right" style="width: 45%; height: 18px"></td>
                            <td class="auto-style3"></td>
                            <td style="width: 54%; height: 18px">
                               
                            </td>
                        </tr>
                        <tr id="trDownloadBrief" runat="server">
                            <td align="right">To Download your Brief Document</td>
                            <td>&nbsp;&nbsp;:&nbsp;&nbsp;</td>
                            <td id="tdUploadBriefDoc" runat="server" align="left"></td>
                        </tr>
                    <tr id="trDownloadGD" runat="server">
                            <td align="right">To Download your GD Document</td>
                            <td>&nbsp;&nbsp;:&nbsp;&nbsp;</td>
                            <td id="tdUploadGDDoc" runat="server" align="left"></td>
                        </tr>
                        <tr>
                            <td align="right" colspan="3" style="height: 30px; text-align: center">
                                <asp:Button ID="btnSave" runat="server" SkinID="buttonSkin" Text="Save" OnClick="btnSave_Click"  />
                                &nbsp; &nbsp;
                                  &nbsp; &nbsp;
                                <asp:Button ID="btnCancel" runat="server" CausesValidation="false" OnClick="btnCancel_OnClick" SkinID="buttonSkin" Text="Cancel" />
                            
                            </td>
                        </tr>
                        <tr>
                            <td align="right" colspan="3" style="height: 30px; text-align: center">
                             </td>
                        </tr>
                </tbody>
            </table>

     <script>
         
    </script>       
</asp:Content>

